<?php
  INCLUDE "F_CONX.php";

  $V_ANIO     = $HTTP_POST_VARS["V_ANIO"];
  $V_MES      = $HTTP_POST_VARS["V_MES"];
  $V_ZONA     = $HTTP_POST_VARS["V_ZONA"];

  $MS_SQL        = "SELECT * FROM intercambio where area = '$V_ZONA'";
  $MS_RESULT     = MYSQL_QUERY($MS_SQL);
  WHILE($A_DINT  = MYSQL_FETCH_ARRAY($MS_RESULT))
  {
     $V_ENE      = $HTTP_POST_VARS["V_ENE".$A_DINT[1]];
     $V_DEM      = $HTTP_POST_VARS["V_DEM".$A_DINT[1]];
     $V_FP       = $HTTP_POST_VARS["V_FP".$A_DINT[1]];
     $V_IMP      = $HTTP_POST_VARS["V_IMP".$A_DINT[1]];
     //$V_IVA      = $HTTP_POST_VARS["V_IVA".$A_DINT[1]];
     $V_IVA      = ($V_IMP*(.15));
     $V_TOT      = $V_IMP+$V_IVA;
     $MS_SQL2     = "INSERT INTO datosi VALUES ('".$V_ZONA.$A_DINT[1]."','$V_ANIO','$V_MES','$V_ENE','$V_DEM','$V_FP','".ROUND($V_IMP,2)."','".ROUND($V_IVA,2)."','".ROUND($V_TOT,2)."')";
     $MS_RESULT2  = MYSQL_QUERY($MS_SQL2);
  }
  HEADER ("LOCATION: P_BODY.php");
?>
